package com.ruoyi.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.LhqTeachingMaterialMapper;
import com.ruoyi.domain.LhqTeachingMaterial;
import com.ruoyi.service.ILhqTeachingMaterialService;
import com.ruoyi.common.core.text.Convert;

/**
 * 教材Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-09-08
 */
@Service
public class LhqTeachingMaterialServiceImpl implements ILhqTeachingMaterialService 
{
    @Autowired
    private LhqTeachingMaterialMapper lhqTeachingMaterialMapper;

    /**
     * 查询教材
     * 
     * @param id 教材ID
     * @return 教材
     */
    @Override
    public LhqTeachingMaterial selectLhqTeachingMaterialById(Long id)
    {
        return lhqTeachingMaterialMapper.selectLhqTeachingMaterialById(id);
    }

    /**
     * 查询教材列表
     * 
     * @param lhqTeachingMaterial 教材
     * @return 教材
     */
    @Override
    public List<LhqTeachingMaterial> selectLhqTeachingMaterialList(LhqTeachingMaterial lhqTeachingMaterial)
    {
        return lhqTeachingMaterialMapper.selectLhqTeachingMaterialList(lhqTeachingMaterial);
    }

    @Override
    public List<LhqTeachingMaterial> selectLhqTeachingMaterialListGl(LhqTeachingMaterial lhqTeachingMaterial) {
        return lhqTeachingMaterialMapper.selectLhqTeachingMaterialListGl(lhqTeachingMaterial);
    }

    /**
     * 新增教材
     * 
     * @param lhqTeachingMaterial 教材
     * @return 结果
     */
    @Override
    public int insertLhqTeachingMaterial(LhqTeachingMaterial lhqTeachingMaterial)
    {
        return lhqTeachingMaterialMapper.insertLhqTeachingMaterial(lhqTeachingMaterial);
    }

    /**
     * 修改教材
     * 
     * @param lhqTeachingMaterial 教材
     * @return 结果
     */
    @Override
    public int updateLhqTeachingMaterial(LhqTeachingMaterial lhqTeachingMaterial)
    {
        return lhqTeachingMaterialMapper.updateLhqTeachingMaterial(lhqTeachingMaterial);
    }

    /**
     * 删除教材对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLhqTeachingMaterialByIds(String ids)
    {
        return lhqTeachingMaterialMapper.deleteLhqTeachingMaterialByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除教材信息
     * 
     * @param id 教材ID
     * @return 结果
     */
    @Override
    public int deleteLhqTeachingMaterialById(Long id)
    {
        return lhqTeachingMaterialMapper.deleteLhqTeachingMaterialById(id);
    }
}
